﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>@ViewBag.Title</title>
      <link href="~/content/admin/css/base.css" rel="stylesheet" />
     <link href="~/content/admin/css/common.css" rel="stylesheet" />
     @RenderSection("css", false)
</head>

<body class="h">
     <div class="navbar">
      <a class="topfont fl">管理系统</a>  
        <ul class="fr">
            <li class="navbar-itemline"></li>
            <li class="navbar-item">消息1</li>
            <li class="navbar-itemline"></li>
             <li class="navbar-item">测试2</li>
        </ul>
    </div>
    <div class="h">
        <div class=" h" style="width:225px;position:absolute;"> 
            <div id="sidebar" class="sidebar">
                <ul>
                    <li>
                        <a id="sidebar-1" class="sidebar-parentbc" href="">公告</a>
                       <ul>
                            <li><a id="sidebar-11" href="@Url.Action("Index", "Bulletin")">公告列表</a></li>
                            <li><a id="sidebar-12" href="@Url.Action("Create", "Bulletin")">添加公告</a></li>
                        </ul>
                    </li>
                    <li>
                        <a id="sidebar-2" class="sidebar-parentbc" href="">新闻</a>
                        <ul>
                            <li><a id="sidebar-3" href="@Url.Action("Index", "News")">新闻列表</a></li>
                            <li><a id="sidebar-4" href="#">添加新闻</a></li>
                            <li><a id="sidebar-5" href="#">新闻分类</a></li>
                            <li><a id="sidebar-6" href="#">添加新闻分类</a></li>
                        </ul>
                    </li>
                    <li>
                        <a id="sidebar-20" class="sidebar-parentbc" href="#"><span> <!--图标样式--></span>文章
                        </a>
                        <ul>
                            <li><a id="sidebar-7" href="#">文章列表</a></li>
                            <li><a id="sidebar-8" href="#">添加文章</a></li>
                            <li><a id="sidebar-9" href="#">标题</a></li>
                            <li><a id="sidebar-10" href="#">标题</a></li>
                        </ul>
                        <!--子菜单-->
                    </li>
                    <li><a id="A1" class="sidebar-parentbc" href="#"><span>
                        <!--图标样式-->
                    </span>标题</a>
                        <ul>
                            <li><a id="A2" href="#">标题</a></li>
                            <li><a id="A3" href="#">标题</a></li>
                            <li><a id="A4" href="#">标题</a></li>
                            <li><a id="A5" href="#">标题</a></li>
                        </ul>
                        <!--子菜单-->
                    </li>
                </ul>
    </div>
        </div>
        <div style="margin-left:225px;">
            <div class="main-wrapper">
        @RenderBody()
    </div>

        </div>
    </div>
    
    <script type="text/javascript" src="~/Scripts/jquery-1.8.3.min.js"></script>
     @RenderSection("scripts", false)
    <script type="text/javascript">
        $(function () {
            sidebar("@ViewBag.SidebarId");
            @RenderSection("loadend", false)
            //alert(window.location.pathname);
        })
        //要显示的a的id号，不需要加sidebar-
        function sidebar(tabhref) {
            tabhref = "sidebar-" + tabhref;
            //当前选中项
            var tab = $("#" + tabhref);
            //所有子ul
            var childuls = $("#sidebar li ul");
            //所有存在子ul的同级a标记
            var hrchilds = $("#sidebar>ul>li:has(ul)>a");

            childuls.hide();
            tab.attr("class", function () {
                if (tab.parents('li').length == 1) {
                    return "start";
                } else {
                    tab.parent().parent().show().prev().attr("class", "start");
                    return "sub";
                }
            });
            hrchilds.attr("href", "javascript:void(0)");
            //===============存在子标签，可点击展开
            $("<span class=\"arrow\"><</span>").appendTo(hrchilds);//添加箭头
            hrchilds.click(function () {
                $(this).next().slideToggle("fast");
            });
        }
    </script>
   
</body> 
</html>
